package homework.api05.exercise02;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "姜子牙";
        int age = 88;
        String gender = "男";
        String[] otherInfo = {"会算卦","愿者上钩","国师"};
        Person person = new Person(name,age,gender,otherInfo);

        FileOutputStream fos = new FileOutputStream("dato.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(person);
        System.out.println("序列化完毕");
        oos.close();





    }
}
